package com.tinem.platform.web.tool.controller;

import com.baidu.fsg.uid.UidGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.io.IOException;

/**
 * @author fengzhihao
 * @version v1
 * @program: platform
 * @className LinkController
 * @description TODO
 * @site 
 * @company 
 * @create 2020-07-13 19:53
 */
@Slf4j
@Controller
@RequestMapping("uid")
public class UidController {
    @Resource
    UidGenerator generator;

    @GetMapping(value = {"/generate","/generate.do"})
    @ResponseBody
    public String generate() throws IOException {
        return generator.getUID();
    }
}
